App({
  onLaunch: function() {
    //调用API从本地缓存中获取数据
    var logs = wx.getStorageSync('logs') || []
    logs.unshift(Date.now())
    wx.setStorageSync('logs', logs)
  },
  getUserInfo: function(cb) {
    var that = this
    if (this.globalData.userInfo) {
      typeof cb == "function" && cb(this.globalData.userInfo)
    } else {
      //调用登录接口
      wx.getUserInfo({
        withCredentials: false,
        success: function(res) {
          that.globalData.userInfo = res.userInfo
          typeof cb == "function" && cb(that.globalData.userInfo)
        }
      })
    }
  },
  globalData: {
    userInfo: null,
    servicePhone:"15501053088",
    scrollImagesJson:{
          "code": "0000",
          "scrollConf": [
              {
                  "imageId": "1",
                  "path": "http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg",
                  "link": ""
              },
              {
                  "imageId": "2",
                  "path": "http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg",
                  "link": ""
              },
              {
                  "imageId": "3",
                  "path": "http://img06.tooopen.com/images/20160818/tooopen_sy_175833047715.jpg",
                  "link": ""
              }
          ],
          "typeConf": {
              "dcyDesign": {
                  "image": "/images/printing.png",
                  "title": "单页/折页报价"
              },
              "bzDesign": {
                  "image": "/images/box.png",
                  "title": "包装设计报价"
              },
              "qyDesign": {
                  "image": "/images/book.png",
                  "title": "企业VI设计报价"
              },
              "hcDesign": {
                  "image": "/images/card.png",
                  "title": "画册设计印刷报"
              }
          }
    },

    //产品类型
    typeConf:{
        "dcyDesign": {
            "image": "/images/printing.png",
            "title": "单页/折页报价"
        },
        "bzDesign": {
            "image": "/images/box.png",
            "title": "包装设计报价"
        },
        "qyDesign": {
            "image": "/images/book.png",
            "title": "企业VI设计报价"
        },
        "hcDesign": {
            "image": "/images/card.png",
            "title": "画册设计印刷报"
        }
    },
    itemsConf:{
        "dcyDesign": {
            "prePageSize": "单页尺寸",
            "prePageNum": "单页用纸",
            "printNum": "印刷数量"
        },
        "bzDesign": {
            "productCategory": "产品类别",
            "packageType": "包装类型",
            "designLevel": "设计级别"
        },
        "qyDesign": {
            "industryType": "所在行业",
            "designLevel": "级别"
        },
        "hcDesign": {
            "pageType": "画册开本",
            "coverPageType": "封面用纸",
            "innerPageNum": "内页数量"
        }
    },

    itemsDetailConf: {
        "dcyDesign.prePageSize": {
            "16k": "16开（210*285mm）",
            "32k": "32开（210*285mm）",
            "8k-16k": "8开对折页 成品16开",
            "16k-32k": "16开折页 成品32开",
            "8k-3z": "8开三折页",
            "16k-3z": "16开三折页"
        },
        "dcyDesign.prePageNum": {
            "250t": "250g铜版纸",
            "157t": "157g铜版纸",
            "128t": "128g铜版纸",
            "105t": "105g铜版纸",
            "250b": "250g白卡纸"
        },
        "dcyDesign.printNum": {
            "2000": "2000页",
            "3000": "3000页",
            "5000": "5000页",
            "10000": "10000页"
        },
        "bzDesign.productCategory": {
            "tea": "茶叶类",
            "food": "食品类",
            "wine": "酒水类",
            "other": "其他类"
        },
        "bzDesign.packageType": {
            "bottle": "瓶体",
            "bag": "袋装",
            "box": "箱装",
            "labeling": "贴标"
        },
        "bzDesign.designLevel": {
            "stand": "标准",
            "medium": "中高端",
            "high": "顶级高级"
        },
        "qyDesign.industryType": {
            "dringfun": "餐饮与娱乐",
            "intenet": "电商与网络"
        },
        "qyDesign.designLevel": {
            "stand": "标准",
            "medium": "中高端",
            "high": "顶级高级"
        },
        "hcDesign.pageType": {
            "16k": "16开（210*285mm）",
            "32k": "32开（210*285mm）",
            "8k-16k": "8开对折页 成品16开",
            "16k-32k": "16开折页 成品32开",
            "8k-3z": "8开三折页",
            "16k-3z": "16开三折页"
        },
        "hcDesign.coverPageType": {
            "250t": "250g铜版纸",
            "157t": "157g铜版纸",
            "128t": "128g铜版纸",
            "105t": "105g铜版纸",
            "250b": "250g白卡纸"
        },
        "hcDesign.innerPageNum": {
            "8p": "8p",
            "12p": "12p",
            "16p": "16p"
        }
    },

    apiData:{
    initUp:'https://testfiles.cailebang.com/litterApplet/api.php?method=initUpData',
    initPItems:'https://testfiles.cailebang.com/litterApplet/api.php?method=initPItems',
    calcPrice:'https://testfiles.cailebang.com/litterApplet/api.php?method=calcPrice'
    }
  }
})